package com.bbs2.service;

import com.bbs2.dao.UserDao;
import com.bbs2.entity.User;

public class UserService {
	UserDao udao = new UserDao();
	public User login(String name,String pwd){
		return udao.findByNameAndPwd(name, pwd);
	}
	public boolean checkUserName(String name){
		if(udao.findByName(name) == null){
			return true;
		}
		return false;
	}
	public int reg(User user) {
		return udao.save(user);
	}
	public User findById(String id){
		return udao.findById(id);
	}
	public int update(User user){
		return udao.update(user);
	}
	public int del(String id){
		return udao.del(id);
	}
}
